var t = getApp(), a = require("../../mybehaviors/location/location");

Page({
    behaviors: [ a ],
    data: {
        yz_basic_info: {},
        address: "",
        showContent: !1,
        carousels: [],
        projects: [],
        workers: [],
        appointmentLang: {},
        city: "",
        title: "",
        pos: {}
    },
    onLoad: function(a) {
        var n = this;
        this._getLocation(function(a, i) {
            var o = t.qqMapTransBMap(parseFloat(i.lng), parseFloat(i.lat));
            n.setData({
                point: o
            }), n.getIndexData(), n.setData({
                appointmentLang: wx.getStorageSync("yz_basic_info").lang.appointment
            });
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    tolocation: function() {
        wx.navigateTo({
            url: "/packageC/o2o/o2oLocation/o2oLocation?tag=appointment"
        });
    },
    toList: function() {
        var t = JSON.stringify(this.data.appointmentLang);
        wx.navigateTo({
            url: "/packageE/appointment/ProjectList/ProjectList?appointmentLang=" + t
        });
    },
    toTechnicianDetails: function(t) {
        var a = t.currentTarget.dataset.id, n = JSON.stringify(this.data.point);
        wx.navigateTo({
            url: "/packageE/appointment/technician_details/technician_details?worker_id=" + a + "&point=" + n
        });
    },
    toDetails: function(t) {
        var a = t.currentTarget.dataset.id, n = JSON.stringify(this.data.point);
        wx.navigateTo({
            url: "/packageE/appointment/ProjectDetails/ProjectDetails?project_id=" + a + "&point=" + n
        });
    },
    toHot: function() {
        if (this.data.city) {
            var t = JSON.stringify(this.data.point);
            wx.navigateTo({
                url: "/packageE/appointment/hot_technician/hot_technician?city=" + this.data.city + "&point=" + t
            });
        } else wx.showToast({
            title: "请先选择城市",
            icon: "none"
        });
    },
    toUrl: function() {
        var t = JSON.stringify(this.data.appointmentLang);
        wx.navigateTo({
            url: "/packageE/appointment/mine/mine?appointmentLang=" + t
        });
    },
    getIndexData: function() {
        var a = this, n = t.getNetAddresss("plugin.appointment.frontend.index.get-data");
        t._postNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                if (1 !== n.result) return a.tips(n.msg);
                a.setData({
                    carousels: n.data.carousels,
                    projects: n.data.projects,
                    workers: n.data.workers
                }), a.setData({
                    appointmentLang: wx.getStorageSync("yz_basic_info").lang.appointment
                });
            }
        });
    },
    tosearch: function() {
        if (this.data.city) {
            var t = JSON.stringify(this.data.point);
            wx.navigateTo({
                url: "/packageE/appointment/search/search?city=" + this.data.city + "&point=" + t
            });
        } else wx.showToast({
            title: "请先选择城市",
            icon: "none"
        });
    },
    tips: function(t) {
        return wx.showToast({
            title: t,
            icon: "none",
            duration: 2e3
        }), !1;
    }
});